#include"contact.h"

int main(int argc, char* argv[])
{
	//初始化通讯录
	Contact cont;
	InitContact(&cont);
	
	int select = 1;
	while (select)
	{
		printf("***********************\n");
		printf("*  [1]Add   [2]Del    *\n");
		printf("*  [3]Find  [4]Modify *\n");
		printf("*  [5]Clear [6]Sort   *\n");
		printf("*  [7]Show  [0]Quit   *\n");
		printf("***********************\n");
		printf("请选择:");
		scanf("%d", &select);

		if (select == QUIT)
		{
			break;
		}

		switch (select)
		{
		case ADD:
			AddContact(&cont);
			break;
		case DEL:
			DelContact(&cont);
			break;
		case FIND:
			FindContact(&cont);
			break;
		case MODIFY:
			ModifyContact(&cont);
			break;
		case CLEAR:
			ClearContact(&cont);
			break;
		case SORT:
			SortContact(&cont);
			break;
		case SHOW:
			ShowContact(&cont);
			break;
		}
	}

	printf("再见");
	return 0;
}